package StudyCode.summary.mydatetime;

import java.time.LocalDate;
import java.time.Month;
import java.time.temporal.ChronoUnit;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class YearsAndDaysBetweenTwoDates {
	public static void main(String[] args) {
		LocalDate anniversary = LocalDate.of(2000, Month.NOVEMBER, 11);
		LocalDate today = LocalDate.now();
		long yearsBetween = ChronoUnit.YEARS.between(anniversary, today);
		System.out.println("间隔年数是: " + yearsBetween);

		long daysBetween = ChronoUnit.DAYS.between(anniversary, today);
		System.out.println("间隔天数是:" + daysBetween);
	}
}
